/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.perfectday.main.dummyengine.component;

import javax.swing.JLabel;

/**
 *
 * @author Miguel (alakat@gmail.com)
 */
public class DummyCombatTextArea extends javax.swing.JPanel {

    private int indexLineString;
    private JLabel[] lines;
    /**
     * Creates new form DummyCombatTextArea
     */
    public DummyCombatTextArea() {
        initComponents();
        this.lines = new JLabel[6];
        this.lines[0]=line1;
        this.lines[1]=line2;
        this.lines[2]=line3;
        this.lines[3]=line4;
        this.lines[4]=line5;
        this.lines[5]=line6;
        clearTextLines();
        this.repaint();
    }

    /**
     * 
     */
    public void clearTextLines() {
        this.indexLineString=0;
        for (JLabel line : lines) {
            if(line!=null)
                line.setText("");
        }
    }
    
    
    /**
     * Nueva l?nea a aparecer en el texto
     * @param string 
     */
    public void addLine(String string){
        if(this.indexLineString >= this.lines.length){
            clearTextLines();
        }
        this.lines[this.indexLineString].setText(string);
        this.indexLineString++;
    }
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        jLabel1 = new javax.swing.JLabel();
        line1 = new javax.swing.JLabel();
        line6 = new javax.swing.JLabel();
        line3 = new javax.swing.JLabel();
        line2 = new javax.swing.JLabel();
        line4 = new javax.swing.JLabel();
        line5 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(0, 0, 102));
        setLayout(null);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/assets/dummy_assets/text_background.png"))); // NOI18N
        jLabel1.setToolTipText("");
        jLabel1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jLayeredPane1.add(jLabel1);
        jLabel1.setBounds(0, 0, 638, 192);

        line1.setText("<p>Lorem ipsum dolor sit</br> amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit<br> anim id est laborum.</p>");
        line1.setToolTipText("");
        jLayeredPane1.add(line1);
        line1.setBounds(20, 0, 600, 30);
        jLayeredPane1.setLayer(line1, 3);

        line6.setText("ffdsadfsadf");
        line6.setToolTipText("");
        jLayeredPane1.add(line6);
        line6.setBounds(20, 150, 600, 30);
        jLayeredPane1.setLayer(line6, 3);

        line3.setText("ffdsadfsadf");
        line3.setToolTipText("");
        jLayeredPane1.add(line3);
        line3.setBounds(20, 60, 600, 30);
        jLayeredPane1.setLayer(line3, 3);

        line2.setText("ffdsadfsadf");
        line2.setToolTipText("");
        jLayeredPane1.add(line2);
        line2.setBounds(20, 30, 600, 30);
        jLayeredPane1.setLayer(line2, 3);

        line4.setText("ffdsadfsadf");
        line4.setToolTipText("");
        jLayeredPane1.add(line4);
        line4.setBounds(20, 90, 600, 30);
        jLayeredPane1.setLayer(line4, 3);

        line5.setText("ffdsadfsadf");
        line5.setToolTipText("");
        jLayeredPane1.add(line5);
        line5.setBounds(20, 120, 600, 30);
        jLayeredPane1.setLayer(line5, 3);

        add(jLayeredPane1);
        jLayeredPane1.setBounds(6, 6, 640, 190);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JLabel line1;
    private javax.swing.JLabel line2;
    private javax.swing.JLabel line3;
    private javax.swing.JLabel line4;
    private javax.swing.JLabel line5;
    private javax.swing.JLabel line6;
    // End of variables declaration//GEN-END:variables
}
